/**
* @file exception.h
* Code for handle critical system exceptions.
*
* Copyrights 2010 Michal Saman, m.saman@designplus.cz
* This source code is release under the Apache License 2.0.
* http://www.apache.org/licenses/LICENSE-2.0
*/

#ifndef _EXCEPTION_H
#define _EXCEPTION_H

#include <stdint.h>

void __attribute__ ((cdecl)) exceptions_install();

/**
* System exceptions handlers
*/
extern void __attribute__ ((cdecl)) divide_by_zero_fault(uint32_t cs, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) single_step_trap(uint32_t cs, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) nmi_trap(uint32_t cs, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) breakpoint_trap(uint32_t cs, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) overflow_trap(uint32_t cs, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) bound_check_fault(uint32_t cs, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) invalid_opcode_fault(uint32_t cs, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) no_device_fault(uint32_t cs, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) double_fault_abort(uint32_t cs, uint32_t err, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) invalid_tss_fault(uint32_t cs, uint32_t err, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) no_segment_fault(uint32_t cs, uint32_t err, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) stack_fault(uint32_t cs, uint32_t err, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) general_protection_fault(uint32_t cs, uint32_t err, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) page_fault(uint32_t cs, uint32_t err, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) fpu_fault(uint32_t cs, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) aligment_check_fault(uint32_t cs, uint32_t err, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) machine_check_abort(uint32_t cs, uint32_t eip, uint32_t eflags);
extern void __attribute__ ((cdecl)) simd_fpu_fault(uint32_t cs, uint32_t eip, uint32_t eflags);

#endif
